import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router'
import RevenueDetails from "../views/income/RevenueDetails";

const routes = [
  {
    path:'/',
    name:'login',
    component:() => import('../views/Login'),
    meta:{title:'家庭财务管理',icon:''}
  },
  {
    path: '/Home',
    name: 'home',
    component: () => import('../views/Home'),
    meta: {title: '后台管理',icon: ''},
    redirect: '/Main',
    children: [
        /*所有子页面*/
      {
        path: '/RevenueDetails',
        name:'RevenueDetails',
        component: () =>import('../views/income/RevenueDetails')
      },
      {
        path: "/Main",
        name: "/main",
        component: () =>import("../views/Main")
      },
      {
        path: '/ExpenditureManagement',
        name: 'ExpenditureManagement',
        component: () => import("../views/expenditure/ExpenditureManagement"),
        meta: {title: '支出管理',icon:''}
      },
      {
        path: '/Person',
        name: 'Person',
        component:() => import("../views/user/Person"),
        meta: {title: '个人信息',icon: ''}
      },
      {
        path: '/ExpenditureReport',
        name: 'ExpenditureReport',
        component:() => import('../views/report/ExpenditureReport'),
        meta: {title: '支出报表',icon: ''}
      },
      {
        path: '/IncomeReport',
        name: 'IncomeReport',
        component:() => import('../views/report/IncomeReport'),
        meta: {title: '收入报表',icon: ''}
      },
      {
        path: '/FamilyMember',
        name: 'FamilyMember',
        component:() => import('../views/user/FamilyMember'),
        meta: {title: '成员管理',icon: ''}
      }
    ]
  },
]

/*使用的createWebHashHistory模式，浏览器路径带#符号*/
const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes
})

export default router
